﻿@model WineStore.Models.Sim
@{
    ViewBag.Title = "CreateSim";
    Layout = "~/Views/Shared/AdminLayout.cshtml";
}

@section Styles
{
    <style type="text/css">
        input, textarea, select {
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 3px;
            width: 200px;
            color: #333;
            box-shadow: rgba(0,0,0,0.1)0px 0px 8px;
            -moz-box-shadow: rgba(0,0,0,0.1)0px 0px 8px;
            -webkit-box-shadow: rgba(0,0,0,0.1)0px 0px 8px;
            margin: 5px;
        }

        textarea {
            width: 400px;
            height: 100px;
            max-width: 400px;
            line-height: 18px;
            border-radius: 3px;
            margin: 5px;
        }


            input:hover, textarea:hover, select:hover input:focus, textarea:focus, select:focus {
                border-color: 10px solid #C9C9C9;
                box-shadow: rgba(0,0,0,0.2)0px 0px 8px;
                -moz-box-shadow: rgba(0,0,0,0.2)0px 0px 8px;
                -webkit-box-shadow: rgba(0,0,0,0.2)0px 0px 8px;
                border-radius: 3px;
            }

        input .submit {
            height: 38px;
            background-color: #474E69;
            color: #FFF;
            border-radius: 3px;
            -moz-border-radius: 3px;
            -webkit-border-radius: 3px;
            margin: 5px;
        }
    </style>
}

@section Scripts{
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}

<!-- Table (TABLE) -->
@if (Session["Admin"] != null)
{
    <h3 class="tit">Thêm Sim
    </h3>
    <fieldset>
        <legend>Thêm Sim</legend>
        @using (Html.BeginForm("CreateSim", "Sim", FormMethod.Post, new { enctype = "multipart/form-data" }))
        { 
            @Html.ValidationSummary(true)
            <table class="nostyle">
                <tbody>
                    <tr>
                        <td>Tên nhà mạng:<span style="color: Red">(*)</span>
                        </td>
                        <td>
                            @*name va id phai co gia tri giong ten truong trong database*@
                            @Html.DropDownListFor(model => model.SupplierId, null, "-- Tên nhà mạng --", new { style = "width:212px;" })
                        </td>
                        <td style="color: Red;">
                            @Html.ValidationMessageFor(model => model.SupplierId)
                        </td>
                    </tr>
                    <tr>
                        <td>Tên nhóm:<span style="color: Red">(*)</span>
                        </td>
                        <td>
                            @*name va id phai co gia tri giong ten truong trong database*@
                            @Html.DropDownListFor(model => model.CategorySimId, null, "-- Nhóm sim --", new { style = "width:212px;" })
                        </td>
                        <td style="color: Red;">
                            @Html.ValidationMessageFor(model => model.CategorySimId)
                        </td>
                    </tr>
                    <tr>
                        <td>Số Sim:<span style="color: Red">(*)</span>
                        </td>
                        <td>
                            @*name va id phai co gia tri giong ten truong trong database*@
                            @Html.EditorFor(model => model.SimNumber)
                        </td>
                        <td style="color: Red;">
                            @Html.ValidationMessageFor(model => model.SimNumber)
                        </td>
                    </tr>
                    <tr>
                        <td>Giá Sim:<span style="color: Red">(*)</span>
                        </td>
                        <td>
                            @*name va id phai co gia tri giong ten truong trong database*@
                            @Html.EditorFor(model => model.SimPrice)
                        </td>
                        <td style="color: Red;">
                            @Html.ValidationMessageFor(model => model.SimPrice)
                        </td>
                    </tr>
                    <tr>
                        <td>Ghi chú:</td>
                        <td>
                            @*name va id phai co gia tri giong ten truong trong database*@
                            @Html.EditorFor(model => model.SimNotice)
                        </td>
                        <td style="color: Red;">
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="submit" value="Thêm mới" class="submit" style="width: 100px; cursor: pointer;" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <b>Chú ý:</b> Những trường đánh dấu <span style="color: Red">(*)</span>là bắt buộc.
                        </td>
                    </tr>
                </tbody>
            </table>
        }
    </fieldset>
}
else
{
    Response.Redirect("~/Admin/LogOn/");
}